<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'portfolio-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
        <?php echo $form->hiddenField($model,'portfolionameID'); ?>
	<div class="row">
		<?php echo $form->labelEx($model,'date'); ?>
		<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                'model' => $model,
                'attribute' => 'date',
                // additional javascript options for the date picker plugin
                'options' => array(
                    'showAnim' => 'fold',
                    'dateFormat' => 'dd/mm/yy',
                    'changeMonth' => true,
                    'changeYear' => true,
                    'yearRange' => '-20:+20',
                    'constrainInput' => true,
                ),
                'htmlOptions' => array(
                    'id' => 'datepicker'
                ),
            )); ?>
		<?php echo $form->error($model,'date'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'companyID'); ?>
		<?php //echo $form->textField($model,'companyID'); ?>
		<?PHP echo $form->dropDownList($model,'companyID',$model->getCompany()); ?>
		<?php echo $form->error($model,'companyID'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'quantity_m'); ?>
		<?php echo $form->textField($model,'quantity_m'); ?>
		<?php echo $form->error($model,'quantity_m'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'price_m'); ?>
		<?php echo $form->textField($model,'price_m'); ?>
		<?php echo $form->error($model,'price_m'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'amount_m'); ?>
		<?php echo $form->textField($model,'amount_m'); ?>
		<?php echo $form->error($model,'amount_m'); ?>
	</div>

	<div class="row">
		<?PHP
		$type_A=0;
		if(isset($_GET['type']))
		{
			if($_GET['type']==0||$_GET['type']==1)
			$type_A = $_GET['type'];			
		}
		echo "<input name=\"Portfolio[type]\" id=\"Portfolio_type\" value=\"$type_A\" type=\"hidden\">"
		?>
	</div>

	<div class="row">
		<?PHP echo "<input name=\"Portfolio[status]\" id=\"Portfolio_status\" value=\"0\" type=\"hidden\">"; ?>
		<?php //echo $form->labelEx($model,'status'); ?>
		<?php //echo $form->textField($model,'status'); ?>
		<?php //echo $form->error($model,'status'); ?>
	</div>

	<div class="row">
		<input name="Portfolio[portfolionameID]" id="Portfolio_portfolionameID" type="hidden" value="<?PHP echo $_GET['port']; ?>">
		<?php //echo $form->labelEx($model,'portfolionameID'); ?>
		<?php //echo $form->textField($model,'portfolionameID'); ?>
		<?php //echo $form->error($model,'portfolionameID'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->